This repository was archived by the owner on Aug 7, 2021. It is now read-only.
feat(snapshot): The parameters passed to mksnapshot are now retrieved… #789
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Related to NativeScript/android#1263
What is the current behavior?
The parameters passed to the mksnapshot tool are hardcoded in the webpack plugin (for example the
--profile_deserialization
flag).What is the new behavior?
The parameters passed to the mksnapshot tool are retrieved from the settings.json file of the installed android runtime. A fallback mechanism is provided for older android runtimes which do not have those parameters.
Why is this change required?
Recent V8 versions (notably >= 7.0) have become very strict on the parameters passed to mksnapshot. They must exactly match the parameters used to create V8's internal snapshot during the compilation process. Otherwise the layout of the snapshot binary might become invalid and result into segmentation faults. Because those parameters are very strictly related to the V8 version it makes more sense to store them as part of the runtime as they might change often.
For reference, here's a related issue in which we have discussed with Google engineers, various crashes related to those parameters: https://bugs.chromium.org/p/v8/issues/detail?id=8576. For example the
--turbo_instruction_scheduling
flag must now be specified.